from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.viewlets.common import ViewletBase
from Products.Five.browser import BrowserView

class uriachFileView(BrowserView):
    
    render = ViewPageTemplateFile("templates/uriach_file_view.pt")
    
    def test(self, bool, yes, no):
        #import pdb;pdb.set_trace()
        if bool:
            return yes
        else:
            return no
    
class uriachDirectFileView(BrowserView):
    
    render = ViewPageTemplateFile("templates/uriach_direct_file_view.pt")
    
    def setUriachFileContentFilter(self):
        myFilter = {}
        myFilter['portal_type'] = 'UriachFile'
        myFilter['review_state']=['published', 'external', 'web_published','internally_published']
        myFilter['sort_on']='getObjPositionInParent'
        return myFilter
    
    def test(self, bool, yes, no):
        #import pdb;pdb.set_trace()
        if bool:
            return yes
        else:
            return no